﻿package mortal.game.view.common
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import flash.events.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.manager.*;
    import mortal.mvc.core.*;

    public class HintBaseIcon extends View
    {
        protected var _icon:GBitmap;
        private var _iconName:String;
        private var _label:GTextFiled;
        private var _swfPlayer:SWFPlayer;

        public function HintBaseIcon(param1:String)
        {
            this._iconName = param1;
            this.layer = LayerManager.smallIconLayer;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.mouseChildren = false;
            this.buttonMode = true;
            this.mouseEnabled = true;
            this._icon = UIFactory.gBitmap(this._iconName, 0, 0, this);
            var _loc_1:* = GlobalStyle.textFormatBai;
            this._label = UIFactory.gTextField("", 14, 11, 20, 20, this, _loc_1);
            this._swfPlayer = UICompomentPool.getUICompoment(SWFPlayer);
            this.addChild(this._swfPlayer);
            this.addAroundEffect();
            this.configEventListener(MouseEvent.CLICK, this.clickHandler);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._icon.dispose(param1);
            this._label.dispose(param1);
            this._swfPlayer.dispose(param1);
            this._icon = null;
            this._label = null;
            this._swfPlayer = null;
            return;
        }// end function

        protected function clickHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function addAroundEffect() : void
        {
            this._swfPlayer.move(19 - 2, 21 - 5);
            this._swfPlayer.timeRate = 3;
            this._swfPlayer.load("SmallIcon_Around.swf", ModelType.NormalSwf, null);
            return;
        }// end function

        public function setLabel(param1:int) : void
        {
            if (param1 > 1)
            {
                this._label.text = param1.toString();
            }
            else
            {
                this._label.text = "";
            }
            return;
        }// end function

    }
}
